home *** CD-ROM | disk | FTP | other *** search
/ Download Now 8 / Download Now V8.iso / Program / InternetTools / ApacheWebServer1.3.6 / apache_1_3_6_win32.exe / _SETUP.1 / readdir.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-12  |  1.2 KB  |  37 lines

  1. /*
  2.  * Structures and types used to implement opendir/readdir/closedir
  3.  * on Windows 95/NT.
  4.  */
  5.  
  6. #include <io.h>
  7. #include <stdio.h>
  8. #include <stdlib.h>
  9. #include <sys/types.h>
  10.  
  11. #ifndef API_EXPORT
  12. # define API_EXPORT(type)    __declspec(dllexport) type __stdcall
  13. #endif
  14.  
  15. /* struct dirent - same as Unix */
  16. struct dirent {
  17.     long d_ino;                    /* inode (always 1 in WIN32) */
  18.     off_t d_off;                /* offset to this dirent */
  19.     unsigned short d_reclen;    /* length of d_name */
  20.     char d_name[_MAX_FNAME+1];    /* filename (null terminated) */
  21. };
  22.  
  23. /* typedef DIR - not the same as Unix */
  24. typedef struct {
  25.     long handle;                /* _findfirst/_findnext handle */
  26.     short offset;                /* offset into directory */
  27.     short finished;             /* 1 if there are not more files */
  28.     struct _finddata_t fileinfo;  /* from _findfirst/_findnext */
  29.     char *dir;                  /* the dir we are reading */
  30.     struct dirent dent;         /* the dirent to return */
  31. } DIR;
  32.  
  33. /* Function prototypes */
  34. API_EXPORT(DIR *) opendir(const char *);
  35. API_EXPORT(struct dirent *) readdir(DIR *);
  36. API_EXPORT(int) closedir(DIR *);
  37.